/*
 * MainWindow.h
 * 
 *  Created on: Dec 28, 2010
 *  Author: Kevin Mueller
 */

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTranslator>

class Compass;
class ArrivalGauge;
class TimeGauge;
class VelocityGauge;
class DistanceGauge;
class CurrentRoad;
class MapWidget;
class IlluminateDisplay;

class RouteSettings;

class QWidget;
class QPushButton;

class PLLayout;
class QBoxLayout;
class QApplication;

typedef enum {
	HORIZONTAL, VERTICAL
} Orientation;

class MainWindow: public QMainWindow {
Q_OBJECT

public:
	MainWindow(const QApplication& app, QWidget* parent);
	~MainWindow();

	bool init();

	bool isFullScreen() const;

signals:
	void retranslateRequest();
	void increaseKeyPressed();
	void decreaseKeyPressed();

public slots:
	void switchLanguage();
	void showRoute();
	void startNavigation();
	void stopNavigation();

protected:
	//		bool event(QEvent * event);
	void closeEvent(QCloseEvent *event);
	void resizeEvent(QResizeEvent *event);
	void hideEvent(QHideEvent *event);
	void showEvent(QShowEvent *event);
	void enterEvent(QEvent * event);
	void leaveEvent(QEvent * event);
	void keyPressEvent(QKeyEvent * event);

private slots:
	void toggleFullScreen();
	void changedDisplayOrientationSetting();

	void showAbout();
	void showGPS();
	void showPreferences();
	void showPOI();
	void showSearch();

	void retranslateUi();

	void volumeKeysGrabber();

private:

	QTranslator qtTranslator;
	QTranslator appTranslator;

	QPushButton *bFullScreen;
	QPushButton *bPositioning;
	QPushButton *bStopNavigation;

	QAction* aboutAction;
	QAction* gpsAction;
	QAction* searchAction;
	QAction* preferencesAction;
	QAction* poiAction;
	QAction* routeAction;

	PLLayout *autoLayout;
	QBoxLayout *landscapeLayout;
	QBoxLayout *portraitLayout;
	QWidget *mainWidget;

	MapWidget* map;
	TimeGauge *time;
	VelocityGauge *velocity;
	ArrivalGauge *arrival;
	DistanceGauge *distance;
	Compass *compass;
	CurrentRoad* curRoad;

	IlluminateDisplay *illuminator;


	bool subWidgetActivated;

	//	void init();

	void createActions();
	void createComponents();
	void createButtons();
	void createContextMenue();

	void createAutoLayout();
	void selfAssignLayout();
	void createLandscape();
	void createPortrait();
};

#endif
